<?php
/**
 * Created by PhpStorm.
 * User: mac
 * Date: 2018/6/27
 * Time: 16:42
 */

namespace app\common\model;


use think\Model;

class Invite extends Model
{
    //根据用户ID获取该用户邀请的记录
    public function getInviteById($id,$page,$pageSize = 10){
        if(!$id && !is_numeric($id)){
            exception("传递的ID不合法");
        }
        $where = array(
            'user_id' => $id
        );
        $offset = ($page - 1) * $pageSize;
        return $this->where($where)->limit($offset,$pageSize)->select();
    }
}